class ShakeItController < ApplicationController	
	before_filter :authorize_admin
	
	def test_mail
		to = params[:to_email]
		from = params[:from_email]
		text = params[:text]

		Mailer.deliver_test(to, text, from)
		
		flash[:notice] = "Sent test message"
		
		redirect_to :action => "index"
	end
	
	def test_error
		error_message = params[:error_message]
		raise error_message
	end
	
	def authorize_shake
		if File.exists? File.join(File.expand_path(RAILS_ROOT), 'my_heart')
			return
		end
		
		raise 'unknown action'
	end
end
